package com.controller;

import com.pojo.Dept;
import com.service.DeptService;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.CrossOrigin;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

@CrossOrigin(origins = "http://localhost:8080")
@RestController
@RequestMapping("/dept")
@ResponseBody
public class DeptController {
    @Autowired
    private DeptService deptService;
    @RequestMapping("/findAllDept")
       public List<Dept> findAllDept(){
           return deptService.findAllDept();
       }
}
